package com.hyj.shop.project.goods.controller;

import com.hyj.shop.project.goods.domain.Goods;
import com.hyj.shop.project.utils.controller.BaseController;
import com.hyj.shop.project.utils.domain.Msg;
import com.hyj.shop.project.goods.service.HotGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.hyj.shop.project.utils.page.TableDataInfo;
import java.util.List;

@Controller
@RequestMapping("/api/hotGoods")
public class HotGoodsController extends BaseController {
        @Autowired
        private HotGoodsService hotGoodsService;
        @RequestMapping(value = "/findByPage")
        @ResponseBody
        public Msg findByPage() {
            return hotGoodsService.queryGoodsByPage();



    }
    @RequestMapping(value = "/findAll")
    @ResponseBody
    public TableDataInfo findAll(Goods goods) {
        startPage();
        List<Goods> list = hotGoodsService.selectGoodsByPage(goods);
        return getDataTable(list);


    }
}
